<?php
namespace LPCISII\PHP2012Bundle\Entity;
use Doctrine\ORM\Mapping as ORM;

/**
  * @ORM\Entity(repositoryClass="LPCISII\PHP2012Bundle\Repository\ArticlesRepository")
  * @ORM\Table(name="articles")
  * @ORM\HasLifecycleCallbacks()
  */

class Articles {
	/**
	  * @ORM\Id
	  * @ORM\Column(type="integer")
	  * @ORM\GeneratedValue(strategy="AUTO")
	  */
    protected $reference;
	
	/**
	  * @ORM\Column(type="string")
	  */
	protected $nom;

	/**
	  * @ORM\Column(type="text")
	  */
	protected $descriptif;
	
	/**
	  * @ORM\Column(type="float")
	  */
	protected $prix;
	
	/**
	  * @ORM\Column(type="integer")
	  */
	protected $delais;
	
	/**
	  *@ORM\Column(type="float")
	  */ 
	protected $poids;

        /**
          * @ORM\ManyToOne(targetEntity="Categories", inversedBy="articles")
          * @ORM\JoinColumn(name="idCa", referencedColumnName="idCa")
          */
	protected $categorie;
	 
	/**
          * @ORM\OneToMany(targetEntity="Images", mappedBy="article")
          */
	protected $images;  
    
  
	public function getReference() {
		return $this->reference;
	}
	
	public function setReference($reference) {
		$this->reference = $reference;
	}

	public function getNom() {
        return $this->nom;
    }

    public function setNom($nom) {
        $this->nom = $nom;
    }
	
	public function getDescriptif() {
        return $this->descriptif;
    }

    public function setDescriptif($descriptif) {
        $this->descriptif = $descriptif;
    }
	
	public function getPrix() {
        return $this->prix;
    }

    public function setPrix($prix) {
        $this->prix = $prix;
    }
	
	public function getDelais() {
        return $this->delais;
    }

    public function setDelais($delais) {
        $this->delais = $delais;
    }
	
	public function getPoids() {
        return $this->poids;
    }

    public function setPoids($poids) {
        $this->poids = $poids;
    }
    public function __construct()
    {
        $this->images = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add images
     *
     * @param LPCISII\PHP2012Bundle\Entity\Images $images
     */
    public function addImages(\LPCISII\PHP2012Bundle\Entity\Images $images)
    {
        $this->images[] = $images;
    }

    /**
     * Get images
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getImages()
    {
        return $this->images;
    }

    /**
     * Add categories
     *
     * @param LPCISII\PHP2012Bundle\Entity\Categories $categories
     */
    public function addCategories(\LPCISII\PHP2012Bundle\Entity\Categories $categories)
    {
        $this->categories[] = $categories;
    }

    /**
     * Get categories
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getCategories()
    {
        return $this->categories;
    }

    /**
     * Add commandes
     *
     * @param LPCISII\PHP2012Bundle\Entity\Commandes $commandes
     */
    public function addCommandes(\LPCISII\PHP2012Bundle\Entity\Commandes $commandes)
    {
        $this->commandes[] = $commandes;
    }

    /**
     * Get commandes
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getCommandes()
    {
        return $this->commandes;
    }

    /**
     * Set categorie
     *
     * @param LPCISII\PHP2012Bundle\Entity\Categories $categorie
     */
    public function setCategorie(\LPCISII\PHP2012Bundle\Entity\Categories $categorie)
    {
        $this->categorie = $categorie;
    }

    /**
     * Get categorie
     *
     * @return LPCISII\PHP2012Bundle\Entity\Categories 
     */
    public function getCategorie()
    {
        return $this->categorie;
    }
    
    public function __toString() {
        return $this->url;
    }
}